package Po;

import Po.DataInterface;
import java.sql.Date;

@SuppressWarnings("serial")
public abstract class Promotion implements DataInterface{
	public Date startDate;
	public Date endDate;
	public Date startPresentDate;
	public Date endPresentDate;
	public int ID;
	
	public abstract double use(double price);
	public abstract String toString();
	public boolean canPresent(){
		Date now = new Date(System.currentTimeMillis());
		return now.compareTo(startPresentDate) > 0 && now.compareTo(endPresentDate)  < 0;
	}
	public boolean canUse(){
		Date now = new Date(System.currentTimeMillis());
		return now.compareTo(startDate) > 0 && now.compareTo(endDate)  < 0;
	}

	@Override
	public boolean equals(Object p) {
		return ID == ((Promotion)p).ID;
	}
	
}
